<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Native Compiling</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"/><LINK
REL="HOME"
TITLE="Cygwin/X Contributor's Guide"
HREF="cygwin-x-cg.html"/><LINK
REL="UP"
TITLE="Programming"
HREF="programming.html"/><LINK
REL="PREVIOUS"
TITLE="Obtaining the Source Code"
HREF="prog-obtaining-source.html"/><LINK
REL="NEXT"
TITLE="Cross Compiling"
HREF="prog-build-cross.html"/><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=utf-8"/></HEAD
><BODY
CLASS="sect1"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Cygwin/X Contributor's Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="prog-obtaining-source.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. Programming</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="prog-build-cross.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"/></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="prog-build-native"
>Native Compiling</A
></H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="prog-compiling"
>Compiling the Source Code</A
></H2
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="prog-compiling-standard"
>Standard Build</A
></H3
><P
>Follow these steps to create a standard, non-debug,
build:</P
><P
>Change the current directory to your X Window System development
directory:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;Username@CygwinHost ~
$ cd ~/xserver

Username@CygwinHost ~/xserver
$ ./configure --prefix=/usr --with-log-dir=/var/log
[lots of output]

Username@CygwinHost ~/xserver
$ make
[lots more output]
</PRE
></TD
></TR
></TABLE
><P
>Standard build is now complete.</P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
You may wish to consult the .cygport file for the current ./configure flags used
in distributed packages
</P
></BLOCKQUOTE
></DIV
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
The unpacked source occupies approximately 80MB of disk space.
Building the source requires approximately an additional 160MB.
On my ageing 2.2MHz Athlon64 3500+, a full build takes about 20 minutes.
</P
></BLOCKQUOTE
></DIV
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
If you wish to keep build products separate from the source, you may
run configure from a separate build directory.</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="prog-compiling-debug"
>Debug Build</A
></H3
><P
>Follow these steps to create a build with debugging
information:</P
><P
>Change the current directory to your X Window System development
directory:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;Username@CygwinHost ~
$ cd ~/xserver

Username@CygwinHost ~/xserver
$ ./configure --prefix=/usr --with-log-dir=/var/log --enable-debug CFLAGS="-g -O0"
[lots of output]

Username@CygwinHost ~/xserver
$ make
[lots more output]
</PRE
></TD
></TR
></TABLE
><P
>Debug build is now complete.</P
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="prog-compiling-executing"
>Running a local build</A
></H2
><P
>Follow these steps to run the built X server:</P
><OL
TYPE="1"
><LI
><P
>Change the current directory to your X Window System build
directory:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;Username@CygwinHost ~
$ cd xserver
Username@CygwinHost ~/xserver
$
</PRE
></TD
></TR
></TABLE
></LI
><LI
><P
>Invoke the hw/xwin/Xwin executable:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;Username@CygwinHost ~/xserver
$ hw/xwin/XWin
</PRE
></TD
></TR
></TABLE
><P
>The X server you have built will now attempt to run.</P
></LI
></OL
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="prog-compiling-install"
>Installing a local build</A
></H2
><P
>&#13;Installing a local build installs the built X server(s) and associated
man pages.
</P
><OL
TYPE="1"
><LI
><P
>Change the current directory to your desired X Window System build
directory:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;Username@CygwinHost ~
$ cd ~/xserver/build/<TT
CLASS="replaceable"
><I
>build-prefix</I
></TT
>

Username@CygwinHost ~/xserver/build/<TT
CLASS="replaceable"
><I
>build-prefix</I
></TT
>
$ 
</PRE
></TD
></TR
></TABLE
></LI
><LI
><P
>Make the <KBD
CLASS="userinput"
>install</KBD
> target, which installs
everything:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="screen"
>&#13;Username@CygwinHost ~/xserver/build/<TT
CLASS="replaceable"
><I
>build-prefix</I
></TT
>
$ make install
</PRE
></TD
></TR
></TABLE
></LI
></OL
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"/><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="prog-obtaining-source.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="cygwin-x-cg.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="prog-build-cross.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Obtaining the Source Code</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="programming.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Cross Compiling</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>